A networking topology of a distributed storage system may be as shown in FIG. 1, and mainly includes a client, a manager node, and several cluster nodes. Generally, a node is a physical machine. A cluster node is a collective name of a master node and a slave node, where each master node is corresponding to one or more slave nodes, and nodes communicate with each other by using a network.
For the distributed storage system shown in FIG. 1, in order to improve a throughput of data processing and overall performance, fragmentation storage and fragment querying are generally performed on data. A commonly used fragmentation is performing a range partition; that is, a large data storage range is divided into several small ranges, and each node is in charge of a continuous range. The so-called “a node is in charge of a range” refers to that a data read/write operation for the range is managed, controlled, and/or executed by the node. When a read/write operation is being performed, a client traverses table entries of a routing table according to a key field of a data operation; finds, according to ranges in the table entries, a node (master node) that is in charge of the range; and performs the read/write operation on the node. Hereinafter, a range that is in the charge of a master node is referred to as a routing range, so as to indicate that the client can find, by using the routing table, the master node in charge of the range and execute a corresponding data operation.
In another aspect, in consideration of reliability, in the distributed storage system, each node generally has at least one data replica, and backup data is usually distributed on different nodes (slave nodes). When data synchronization is being performed between a master node and a slave node, the master node sends a synchronization request that includes information such as a data operation record to the slave node, and the slave node responds to the synchronization request, traverses table entries of a routing table according to a key field of the data operation record, and performs a corresponding backup data synchronization operation for a range in a table entry. Hereinafter, a range in which a master node and a slave node perform a data operation is referred to as a sync range, so as to indicate that the slave node can find the range by using the routing table and execute a corresponding backup data synchronization operation.
In the prior art, a routing range and a sync range have a same size. For example, it is assumed that a node A is used as a master node and is in charge of a range [0, 100], and a node B is used as a slave node of the node A in the range [0, 100]. Therefore, for a client, the range [0, 100] is a routing range that is used to find the node A; for the node A and the node B, the range [0, 100] is a sync range in which the node A and the node B perform a data operation.
As a result, in a case in which a quantity of cluster nodes is fixed, if a quantity of ranges maintained by a node is relatively small, for example, a database Spinnake that performs a range partition according to a primary key, a case in which multiple threads compete for permission for performing a data operation on a same range may occur, and especially for a hot range, a phenomenon of serial execution may be easily caused, which inevitably causes an extension of access time and reduction in data read/write efficiency and backup efficiency, thereby affecting a data processing throughput of a system.
In another aspect, in a case in which a quantity of cluster nodes is fixed, if a quantity of ranges maintained by a node is relatively large, for example, a distributed key value database HyperDex that performs a range partition according to both a primary key and a non-primary key, routing overhead of a client increases due to a relatively large quantity of routing ranges.